<?php
/**
 * View AJAX - ASSOCIA CONTATTI A LOCATION LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    17-mag-2011
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */

if(  count( $this->contacts ) ):
    foreach( $this->contacts AS $contact ) : ?>
    <tr class="unselectable" id="contact_<?php echo $contact['contact_id'] ?>">
    	<th>
	    <span><?php echo $contact['contact_firstname'] ?> <?php echo $contact['contact_lastname'] ?></span>
	    <div class="details">
		<h4><strong>Tel: </strong> <?php echo $contact['contact_phone'] ?></h4>
		<h4><strong>Email: </strong> <?php echo $contact['contact_email'] ?></h4>
	    </div>	    
    	</th>
        <td>
            <ul>
                <li class="complex">
                    <span class="left">
                        <label>Ruolo:</label>
                        <select class="field select addr" name="contact_<?php echo $contact['contact_id'] ?>" id="contact_<?php echo $contact['contact_id'] ?>">
                        <?php foreach( $this->contact_roles AS $k => $role ) : ?>
                            <option value="<?php echo  $k ?>"><?php echo  $role ?></option>
                        <?php endforeach; ?>
                        </select>
                    </span>
                </li>
            </ul>
        </td>
    	<td title="Operazioni">
    	    <span class="actions">
		<a class="del" id="unlink-contact-<?php echo $contact['contact_id']?>" href="#">
                    &nbsp;
                </a>
    	    </span>
    	</td>
    </tr>
    <?php endforeach;
else:
    ?><tr class="result"><td colspan="5">Nessun elemento presente...</td></tr> <?php	
endif;?>